<template>
  <div class="common-layout">
    <!-- 判断当前路由，登录页不显示侧边栏和Header -->
    <el-container v-if="$route.path !== '/login'">
      <el-header>
        <Header />
      </el-header>
      el-container
        <!-- 将侧边栏宽度从 200px 调整为 240px -->
        <el-aside width="240px">
          <Aside />
        </el-aside>
        <el-main>
          <!-- 路由出口 -->
          <router-view />
        </el-main>
      </el-container>
    </el-container>
    <!-- 登录页只显示内容区 -->
    <router-view v-else />
  </div>
</template>

<script setup>
import Header from './components/Header.vue'
import Aside from './components/Aside.vue'
</script>

<style scoped>
.el-aside {
  height: 90vh;
}
.mt-6 {
  margin-top: 1.5rem;
}
</style>